#include <iostream>
using std::cout;
using std::endl;

class Point
{
public:
    Point()
    : _ix(0)
    , _iy(0)
    {
        cout << "Point()" << endl;
    }

    Point(int x,int y = 1)
    : _ix(x)
    , _iy(y)
    {
        cout << "Point(int,int)" << endl;
    }

/*     Point(const Point & rhs) */
/*     : _ix(rhs._ix) */
/*     , _iy(rhs._iy) */
/*     { */
/*         cout << "拷贝构造" << endl; */
/*     } */

    void print(){
        cout << "(" << _ix
            << "," << _iy
            << ")" << endl;
    }
private:
    int _ix;
    int _iy;
};

void test0(){
    int x = 10;
    int y = x;
    /* int y(x); */
    cout << y << endl;

    Point pt(30,50);
    //利用一个已经存在的Point对象
    //用复制的方式创建一个新的Point对象
    Point pt2 = pt;
    /* Point pt2(pt); */
    pt2.print();

}

int main(void){
    test0();
    return 0;
}
